﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mozlite
{
    /// <summary>
    /// 常量定义类。
    /// </summary>
    public static class Consts
    {
        #region contentlength
        /// <summary>
        /// 获取文件大小为TB的字节数。
        /// </summary>
        public const long TBytes = 1024L * 1024 * 1024 * 1024;
        /// <summary>
        /// 获取文件大小为GB的字节数。
        /// </summary>
        public const long GBytes = 1024L * 1024 * 1024;
        /// <summary>
        /// 获取文件大小为MB的字节数。
        /// </summary>
        public const long MBytes = 1024L * 1024;
        /// <summary>
        /// 获取文件大小为KB的字节数。
        /// </summary>
        public const long KBytes = 1024L;
        #endregion

        #region times
        /// <summary>
        /// 获取或设置年份时间。
        /// </summary>
        public const int YearSeconds = 365 * 60 * 60 * 24 * 30;
        /// <summary>
        /// 获取或设置月份时间。
        /// </summary>
        public const int MonthSeconds = 60 * 60 * 24 * 30;
        /// <summary>
        /// 获取或设置日期时间。
        /// </summary>
        public const int DaySeconds = 60 * 60 * 24;
        /// <summary>
        /// 获取或设置小时时间。
        /// </summary>
        public const int HourSeconds = 60 * 60;
        /// <summary>
        /// 获取或设置分钟时间。
        /// </summary>
        public const int MinuteSeconds = 60;
        #endregion

        #region dirs
        internal const string UTIL_DIR_NAME = "App_Utilities";
        internal const string USER_FILES_DIR_NAME = "App_Data/FileStorages";
        internal const string TEMP_DIR_NAME = "App_Temp";
        #endregion

        internal const string DEFAULT_CRYPTOR_SEED = "THEMOZLITEASSEMBLYISAGOODPROJECTFOR.NET4.0ANDLATER!";

        #region pagesize
        /// <summary>
        /// 默认每页显示的记录数。
        /// </summary>
        public const int DefaultPageSize = 20;
        #endregion

        /// <summary>
        /// 密码正则表达式。
        /// </summary>
        public const string PasswordRegex = "^.{6,20}$";
        /// <summary>
        /// 用户名正则表达式。
        /// </summary>
        public const string UserNameRegex = "^[a-zA-Z][a-zA-Z0-9_]{3,15}$";
        /// <summary>
        /// 后台区域名称。
        /// </summary>
        public const string Backend = "Backend";
        /// <summary>
        /// 登录验证码标识。
        /// </summary>
        public const string Login = "login";
        /// <summary>
        /// 唯一键正则表达式。
        /// </summary>
        public const string KeyRegex = "^[a-zA-Z][a-zA-z0-9_]*$";
    }
}
